'''
Author: xialang333@gmail.com
Date: 2025-08-04 14:33:28
LastEditTime: 2025-08-04 14:33:33
'''
from pydantic import BaseModel
from typing import Optional, Dict
from enum import Enum

class ExporterType(str, Enum):
    NODE = "node_exporter"
    CADVISOR = "cadvisor"
    REDIS = "redis_exporter"
    MYSQL = "mysql_exporter"
    CUSTOM = "custom"

class ExporterBase(BaseModel):
    name: str
    type: ExporterType
    host: str
    port: int
    path: Optional[str] = "/metrics"
    enabled: Optional[bool] = True
    scrape_interval: Optional[int] = 15
    labels: Optional[Dict[str, str]] = {}

class ExporterCreate(ExporterBase):
    pass

class Exporter(ExporterBase):
    id: int

    class Config:
        orm_mode = True